fix(mac): allow ad-hoc identities for codesigning#9007
fix(mac): allow ad-hoc identities for codesigning#9007mmaietta merged 3 commits intoelectron-userland:masterfrom
Conversation
Use such identities by default on macOS arm64 rather than doing nothing to prevent "(App) is damaged" warnings.
🦋 Changeset detectedLatest commit: ff7ee6b The changes in this PR will be included in the next version bump. This PR includes changesets to release 8 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
Is there a minimum supported version of |
I think this has been supported since the existence of the In either case, the default use of this affects only ARM/universal builds, which are only relevant to macOS 11+. I can say with certainty that this option existed already at that point. |
|
I found confirmation that |
|
Will cause an error |
Use the fix described at #5850 (comment) if you have manually set entitlements and didn’t include the one described there. |
Fixes #5850
If no signing identity is present while an app is built and it is downloaded via a web browser, macOS on ARM shows "app is damaged" errors that are hard to bypass for the average user (see #5850 and some other duplicates). This seems to be because the default signature applied by the linker to the executables isn't valid due to something the build system is doing [1]. It is thus an error to not manually codesign the resulting app, even if no stable signing identity is available (in which case it must be an ad-hoc signature).
The damaged warning is not the same as the unverified warning. Not paying for a developer account does not mean your app must show "this app is damaged" warnings to users, but it will show an unverified warning. The damaged warning cannot be bypassed through the GUI (such as in System Settings) and requires running commands to remove the quarantine attribute (as of the current macOS version). An unverified warning, on the other hand, has supported GUI methods of bypassing the warning and running the app. A proper (free) ad-hoc signature means that the damaged warning will not show up, but the unverified warning will.
Since there are no problems for those with "proper" signing certificates, it follows that the existing signing system does make a valid signature, and if it can be repurposed to accept empty identities (for ad-hoc signatures), this will resolve the issue. This PR does two main things:
-as theidentity. This is the same convention that thecodesigncommand uses.identitytonull.I tested these changes with FreeTube, which previously showed "'FreeTube' is damaged" warnings.

Before these changes, the warning looks like the below and can't be bypassed in System Settings.
With these changes, the new warning looks like


And System Settings shows an option to bypass the warning like it does on Intel.
[1] For additional details if you're curious, see the macOS 11.0.1 release notes. Specifically (emphasis mine):